package com.icreate.storm.methods.indicators.fieldCreater;

import com.icreate.entity.indicator.IndicatorID;
import com.icreate.entity.indicator.S1_MMEfield;
import com.icreate.entity.indicator.X2field;
import com.icreate.storm.methods.common.DateMethod;
import com.icreate.storm.methods.indicators.fieldCreater.FieldCreater;

/**
 * Created by icreate on 2017/5/21.
 */
public class X2fieldCreater extends BaseSubstring implements FieldCreater<X2field> {
    private int[] indexsBuffer=new int[14];
    @Override
    protected int[] getIndexBuffer() {
        return indexsBuffer;
    }
    public X2field create(String s) {
        /*
        String[] cells = s.split(",");
        String ts = cells[10];
        String cellid = cells[13];
        String imsi = cells[6];
        String imei = cells[7];
        if (ts.equals("") || cellid.equals("") || imsi.equals(""))
            return null;
        String hour = DateMethod.getHour(ts);
        X2field field = new X2field(DateMethod.getDate(ts), cellid, imsi, imei, hour);
        field.setStatus(cells[12]);
        field.setProcedureType(cells[9]);
         */
        setSplitIndexes(s);
        String ts = getCell(10); //cells[10];
        String cellid = getCell(13); //cells[13];
        String imsi = getCell(6); //cells[6];
        String imei = getCell(7); //cells[7];
        if (ts.equals("") || cellid.equals("") || imsi.equals(""))
            return null;
        String hour = DateMethod.getHour(ts);
        X2field field = new X2field(DateMethod.getDate(ts), cellid, imsi, imei, hour);
        field.setStatus( getCell(12));
        field.setProcedureType( getCell(9));
        return field;
    }
}
